home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [R*ch] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 4d 61 6e 75 61 6c | 20 74 65 78 74 20 62 79 |% Manual| text by|
|00000010| 20 4a 61 61 70 20 56 65 | 72 6d 65 75 6c 65 6e 0d | Jaap Ve|rmeulen.|
|00000020| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000030| 6e 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n Module| \sectco|
|00000040| 64 65 7b 66 63 6e 74 6c | 7d 7d 0d 5c 62 69 6d 6f |de{fcntl|}}.\bimo|
|00000050| 64 69 6e 64 65 78 7b 66 | 63 6e 74 6c 7d 0d 5c 69 |dindex{f|cntl}.\i|
|00000060| 6e 64 65 78 69 69 7b 5c | 55 4e 49 58 7b 7d 7d 7b |ndexii{\|UNIX{}}{|
|00000070| 66 69 6c 65 20 63 6f 6e | 74 72 6f 6c 7d 0d 5c 69 |file con|trol}.\i|
|00000080| 6e 64 65 78 69 69 7b 5c | 55 4e 49 58 7b 7d 7d 7b |ndexii{\|UNIX{}}{|
|00000090| 49 2f 4f 20 63 6f 6e 74 | 72 6f 6c 7d 0d 0d 54 68 |I/O cont|rol}..Th|
|000000a0| 69 73 20 6d 6f 64 75 6c | 65 20 70 65 72 66 6f 72 |is modul|e perfor|
|000000b0| 6d 73 20 66 69 6c 65 20 | 63 6f 6e 74 72 6f 6c 20 |ms file |control |
|000000c0| 61 6e 64 20 49 2f 4f 20 | 63 6f 6e 74 72 6f 6c 20 |and I/O |control |
|000000d0| 6f 6e 20 66 69 6c 65 20 | 64 65 73 63 72 69 70 74 |on file |descript|
|000000e0| 6f 72 73 2e 0d 49 74 20 | 69 73 20 61 6e 20 69 6e |ors..It |is an in|
|000000f0| 74 65 72 66 61 63 65 20 | 74 6f 20 74 68 65 20 5c |terface |to the \|
|00000100| 64 66 6e 7b 66 63 6e 74 | 6c 28 29 7d 20 61 6e 64 |dfn{fcnt|l()} and|
|00000110| 20 5c 64 66 6e 7b 69 6f | 63 74 6c 28 29 7d 20 5c | \dfn{io|ctl()} \|
|00000120| 55 4e 49 58 7b 7d 20 72 | 6f 75 74 69 6e 65 73 2e |UNIX{} r|outines.|
|00000130| 0d 46 69 6c 65 20 64 65 | 73 63 72 69 70 74 6f 72 |.File de|scriptor|
|00000140| 73 20 63 61 6e 20 62 65 | 20 6f 62 74 61 69 6e 65 |s can be| obtaine|
|00000150| 64 20 77 69 74 68 20 74 | 68 65 20 5c 64 66 6e 7b |d with t|he \dfn{|
|00000160| 66 69 6c 65 6e 6f 28 29 | 7d 20 6d 65 74 68 6f 64 |fileno()|} method|
|00000170| 20 6f 66 20 61 0d 66 69 | 6c 65 20 6f 72 20 73 6f | of a.fi|le or so|
|00000180| 63 6b 65 74 20 6f 62 6a | 65 63 74 2e 0d 0d 54 68 |cket obj|ect...Th|
|00000190| 65 20 6d 6f 64 75 6c 65 | 20 64 65 66 69 6e 65 73 |e module| defines|
|000001a0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 66 | the fol|lowing f|
|000001b0| 75 6e 63 74 69 6f 6e 73 | 3a 0d 0d 5c 72 65 6e 65 |unctions|:..\rene|
|000001c0| 77 63 6f 6d 6d 61 6e 64 | 7b 5c 69 6e 64 65 78 73 |wcommand|{\indexs|
|000001d0| 75 62 69 74 65 6d 7d 7b | 28 69 6e 20 6d 6f 64 75 |ubitem}{|(in modu|
|000001e0| 6c 65 20 73 74 72 75 63 | 74 29 7d 0d 0d 5c 62 65 |le struc|t)}..\be|
|000001f0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 66 63 |gin{func|desc}{fc|
|00000200| 6e 74 6c 7d 7b 66 64 5c | 2c 20 6f 70 5c 6f 70 74 |ntl}{fd\|, op\opt|
|00000210| 69 6f 6e 61 6c 7b 5c 2c | 20 61 72 67 7d 7d 0d 20 |ional{\,| arg}}. |
|00000220| 20 50 65 72 66 6f 72 6d | 20 74 68 65 20 72 65 71 | Perform| the req|
|00000230| 75 65 73 74 65 64 20 6f | 70 65 72 61 74 69 6f 6e |uested o|peration|
|00000240| 20 6f 6e 20 66 69 6c 65 | 20 64 65 73 63 72 69 70 | on file| descrip|
|00000250| 74 6f 72 20 5c 63 6f 64 | 65 7b 5c 76 61 72 7b 66 |tor \cod|e{\var{f|
|00000260| 64 7d 7d 2e 0d 20 20 54 | 68 65 20 6f 70 65 72 61 |d}}.. T|he opera|
|00000270| 74 69 6f 6e 20 69 73 20 | 64 65 66 69 6e 65 64 20 |tion is |defined |
|00000280| 62 79 20 5c 63 6f 64 65 | 7b 5c 76 61 72 7b 6f 70 |by \code|{\var{op|
|00000290| 7d 7d 20 61 6e 64 20 69 | 73 20 6f 70 65 72 61 74 |}} and i|s operat|
|000002a0| 69 6e 67 20 73 79 73 74 | 65 6d 0d 20 20 64 65 70 |ing syst|em. dep|
|000002b0| 65 6e 64 65 6e 74 2e 20 | 20 54 79 70 69 63 61 6c |endent. | Typical|
|000002c0| 6c 79 20 74 68 65 73 65 | 20 63 6f 64 65 73 20 63 |ly these| codes c|
|000002d0| 61 6e 20 62 65 20 72 65 | 74 72 69 65 76 65 64 20 |an be re|trieved |
|000002e0| 66 72 6f 6d 20 74 68 65 | 20 6c 69 62 72 61 72 79 |from the| library|
|000002f0| 0d 20 20 6d 6f 64 75 6c | 65 20 5c 63 6f 64 65 7b |. modul|e \code{|
|00000300| 46 43 4e 54 4c 7d 2e 20 | 54 68 65 20 61 72 67 75 |FCNTL}. |The argu|
|00000310| 6d 65 6e 74 20 5c 63 6f | 64 65 7b 5c 76 61 72 7b |ment \co|de{\var{|
|00000320| 61 72 67 7d 7d 20 69 73 | 20 6f 70 74 69 6f 6e 61 |arg}} is| optiona|
|00000330| 6c 2c 20 61 6e 64 0d 20 | 20 64 65 66 61 75 6c 74 |l, and. | default|
|00000340| 73 20 74 6f 20 74 68 65 | 20 69 6e 74 65 67 65 72 |s to the| integer|
|00000350| 20 76 61 6c 75 65 20 5c | 63 6f 64 65 7b 30 7d 2e | value \|code{0}.|
|00000360| 20 20 57 68 65 6e 0d 20 | 20 69 74 20 69 73 20 70 | When. | it is p|
|00000370| 72 65 73 65 6e 74 2c 20 | 69 74 20 63 61 6e 20 65 |resent, |it can e|
|00000380| 69 74 68 65 72 20 62 65 | 20 61 6e 20 69 6e 74 65 |ither be| an inte|
|00000390| 67 65 72 20 76 61 6c 75 | 65 2c 20 6f 72 20 61 20 |ger valu|e, or a |
|000003a0| 73 74 72 69 6e 67 2e 20 | 20 57 69 74 68 0d 20 20 |string. | With. |
|000003b0| 74 68 65 20 61 72 67 75 | 6d 65 6e 74 20 6d 69 73 |the argu|ment mis|
|000003c0| 73 69 6e 67 20 6f 72 20 | 61 6e 20 69 6e 74 65 67 |sing or |an integ|
|000003d0| 65 72 20 76 61 6c 75 65 | 2c 20 74 68 65 20 72 65 |er value|, the re|
|000003e0| 74 75 72 6e 20 76 61 6c | 75 65 20 6f 66 20 74 68 |turn val|ue of th|
|000003f0| 69 73 0d 20 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |is. fun|ction is|
|00000400| 20 74 68 65 20 69 6e 74 | 65 67 65 72 20 72 65 74 | the int|eger ret|
|00000410| 75 72 6e 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |urn valu|e of the|
|00000420| 20 72 65 61 6c 20 5c 63 | 6f 64 65 7b 66 63 6e 74 | real \c|ode{fcnt|
|00000430| 6c 28 29 7d 0d 20 20 63 | 61 6c 6c 2e 20 20 57 68 |l()}. c|all. Wh|
|00000440| 65 6e 20 74 68 65 20 61 | 72 67 75 6d 65 6e 74 20 |en the a|rgument |
|00000450| 69 73 20 61 20 73 74 72 | 69 6e 67 20 69 74 20 72 |is a str|ing it r|
|00000460| 65 70 72 65 73 65 6e 74 | 73 20 61 20 62 69 6e 61 |epresent|s a bina|
|00000470| 72 79 0d 20 20 73 74 72 | 75 63 74 75 72 65 2c 20 |ry. str|ucture, |
|00000480| 65 2e 67 2e 5c 20 63 72 | 65 61 74 65 64 20 62 79 |e.g.\ cr|eated by|
|00000490| 20 5c 63 6f 64 65 7b 73 | 74 72 75 63 74 2e 70 61 | \code{s|truct.pa|
|000004a0| 63 6b 28 29 7d 2e 20 54 | 68 65 20 62 69 6e 61 72 |ck()}. T|he binar|
|000004b0| 79 20 64 61 74 61 20 69 | 73 0d 20 20 63 6f 70 69 |y data i|s. copi|
|000004c0| 65 64 20 74 6f 20 61 20 | 62 75 66 66 65 72 20 77 |ed to a |buffer w|
|000004d0| 68 6f 73 65 20 61 64 64 | 72 65 73 73 20 69 73 20 |hose add|ress is |
|000004e0| 70 61 73 73 65 64 20 74 | 6f 20 74 68 65 20 72 65 |passed t|o the re|
|000004f0| 61 6c 20 5c 63 6f 64 65 | 7b 66 63 6e 74 6c 28 29 |al \code|{fcntl()|
|00000500| 7d 0d 20 20 63 61 6c 6c | 2e 20 20 54 68 65 20 72 |}. call|. The r|
|00000510| 65 74 75 72 6e 20 76 61 | 6c 75 65 20 61 66 74 65 |eturn va|lue afte|
|00000520| 72 20 61 20 73 75 63 63 | 65 73 73 66 75 6c 20 63 |r a succ|essful c|
|00000530| 61 6c 6c 20 69 73 20 74 | 68 65 20 63 6f 6e 74 65 |all is t|he conte|
|00000540| 6e 74 73 20 6f 66 0d 20 | 20 74 68 65 20 62 75 66 |nts of. | the buf|
|00000550| 66 65 72 2c 20 63 6f 6e | 76 65 72 74 65 64 20 74 |fer, con|verted t|
|00000560| 6f 20 61 20 73 74 72 69 | 6e 67 20 6f 62 6a 65 63 |o a stri|ng objec|
|00000570| 74 2e 20 20 49 6e 20 63 | 61 73 65 20 74 68 65 0d |t. In c|ase the.|
|00000580| 20 20 5c 63 6f 64 65 7b | 66 63 6e 74 6c 28 29 7d | \code{|fcntl()}|
|00000590| 20 66 61 69 6c 73 2c 20 | 61 6e 20 5c 63 6f 64 65 | fails, |an \code|
|000005a0| 7b 49 4f 45 72 72 6f 72 | 7d 20 77 69 6c 6c 20 62 |{IOError|} will b|
|000005b0| 65 20 72 61 69 73 65 64 | 2e 0d 5c 65 6e 64 7b 66 |e raised|..\end{f|
|000005c0| 75 6e 63 64 65 73 63 7d | 0d 0d 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000005d0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 69 6f 63 74 6c |{funcdes|c}{ioctl|
|000005e0| 7d 7b 66 64 5c 2c 20 6f | 70 5c 2c 20 61 72 67 7d |}{fd\, o|p\, arg}|
|000005f0| 0d 20 20 54 68 69 73 20 | 66 75 6e 63 74 69 6f 6e |. This |function|
|00000600| 20 69 73 20 69 64 65 6e | 74 69 63 61 6c 20 74 6f | is iden|tical to|
|00000610| 20 74 68 65 20 5c 63 6f | 64 65 7b 66 63 6e 74 6c | the \co|de{fcntl|
|00000620| 28 29 7d 20 66 75 6e 63 | 74 69 6f 6e 2c 20 65 78 |()} func|tion, ex|
|00000630| 63 65 70 74 0d 20 20 74 | 68 61 74 20 74 68 65 20 |cept. t|hat the |
|00000640| 6f 70 65 72 61 74 69 6f | 6e 73 20 61 72 65 20 74 |operatio|ns are t|
|00000650| 79 70 69 63 61 6c 6c 79 | 20 64 65 66 69 6e 65 64 |ypically| defined|
|00000660| 20 69 6e 20 74 68 65 20 | 6c 69 62 72 61 72 79 20 | in the |library |
|00000670| 6d 6f 64 75 6c 65 0d 20 | 20 5c 63 6f 64 65 7b 49 |module. | \code{I|
|00000680| 4f 43 54 4c 7d 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |OCTL}..\|end{func|
|00000690| 64 65 73 63 7d 0d 0d 49 | 66 20 74 68 65 20 6c 69 |desc}..I|f the li|
|000006a0| 62 72 61 72 79 20 6d 6f | 64 75 6c 65 73 20 5c 63 |brary mo|dules \c|
|000006b0| 6f 64 65 7b 46 43 4e 54 | 4c 7d 20 6f 72 20 5c 63 |ode{FCNT|L} or \c|
|000006c0| 6f 64 65 7b 49 4f 43 54 | 4c 7d 20 61 72 65 20 6d |ode{IOCT|L} are m|
|000006d0| 69 73 73 69 6e 67 2c 20 | 79 6f 75 0d 63 61 6e 20 |issing, |you.can |
|000006e0| 66 69 6e 64 20 74 68 65 | 20 6f 70 63 6f 64 65 73 |find the| opcodes|
|000006f0| 20 69 6e 20 74 68 65 20 | 43 20 69 6e 63 6c 75 64 | in the |C includ|
|00000700| 65 20 66 69 6c 65 73 20 | 5c 63 6f 64 65 7b 73 79 |e files |\code{sy|
|00000710| 73 2f 66 63 6e 74 6c 7d | 20 61 6e 64 0d 5c 63 6f |s/fcntl}| and.\co|
|00000720| 64 65 7b 73 79 73 2f 69 | 6f 63 74 6c 7d 2e 20 59 |de{sys/i|octl}. Y|
|00000730| 6f 75 20 63 61 6e 20 63 | 72 65 61 74 65 20 74 68 |ou can c|reate th|
|00000740| 65 20 6d 6f 64 75 6c 65 | 73 20 79 6f 75 72 73 65 |e module|s yourse|
|00000750| 6c 66 20 77 69 74 68 20 | 74 68 65 20 68 32 70 79 |lf with |the h2py|
|00000760| 0d 73 63 72 69 70 74 2c | 20 66 6f 75 6e 64 20 69 |.script,| found i|
|00000770| 6e 20 74 68 65 20 5c 63 | 6f 64 65 7b 54 6f 6f 6c |n the \c|ode{Tool|
|00000780| 73 2f 73 63 72 69 70 74 | 73 7d 20 64 69 72 65 63 |s/script|s} direc|
|00000790| 74 6f 72 79 2e 0d 5c 73 | 74 6d 6f 64 69 6e 64 65 |tory..\s|tmodinde|
|000007a0| 78 7b 46 43 4e 54 4c 7d | 0d 5c 73 74 6d 6f 64 69 |x{FCNTL}|.\stmodi|
|000007b0| 6e 64 65 78 7b 49 4f 43 | 54 4c 7d 0d 0d 45 78 61 |ndex{IOC|TL}..Exa|
|000007c0| 6d 70 6c 65 73 20 28 61 | 6c 6c 20 6f 6e 20 61 20 |mples (a|ll on a |
|000007d0| 53 56 52 34 20 63 6f 6d | 70 6c 69 61 6e 74 20 73 |SVR4 com|pliant s|
|000007e0| 79 73 74 65 6d 29 3a 0d | 0d 5c 62 63 6f 64 65 5c |ystem):.|.\bcode\|
|000007f0| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0d |begin{ve|rbatim}.|
|00000800| 69 6d 70 6f 72 74 20 73 | 74 72 75 63 74 2c 20 46 |import s|truct, F|
|00000810| 43 4e 54 4c 0d 0d 66 69 | 6c 65 20 3d 20 6f 70 65 |CNTL..fi|le = ope|
|00000820| 6e 28 2e 2e 2e 29 0d 72 | 76 20 3d 20 66 63 6e 74 |n(...).r|v = fcnt|
|00000830| 6c 28 66 69 6c 65 2e 66 | 69 6c 65 6e 6f 28 29 2c |l(file.f|ileno(),|
|00000840| 20 46 43 4e 54 4c 2e 4f | 5f 4e 44 45 4c 41 59 2c | FCNTL.O|_NDELAY,|
|00000850| 20 31 29 0d 0d 6c 6f 63 | 6b 64 61 74 61 20 3d 20 | 1)..loc|kdata = |
|00000860| 73 74 72 75 63 74 2e 70 | 61 63 6b 28 27 68 68 6c |struct.p|ack('hhl|
|00000870| 6c 68 68 27 2c 20 46 43 | 4e 54 4c 2e 46 5f 57 52 |lhh', FC|NTL.F_WR|
|00000880| 4c 43 4b 2c 20 30 2c 20 | 30 2c 20 30 2c 20 30 2c |LCK, 0, |0, 0, 0,|
|00000890| 20 30 29 0d 72 76 20 3d | 20 66 63 6e 74 6c 28 66 | 0).rv =| fcntl(f|
|000008a0| 69 6c 65 2e 66 69 6c 65 | 6e 6f 28 29 2c 20 46 43 |ile.file|no(), FC|
|000008b0| 4e 54 4c 2e 46 5f 53 45 | 54 4c 4b 57 2c 20 6c 6f |NTL.F_SE|TLKW, lo|
|000008c0| 63 6b 64 61 74 61 29 0d | 5c 65 6e 64 7b 76 65 72 |ckdata).|\end{ver|
|000008d0| 62 61 74 69 6d 7d 5c 65 | 63 6f 64 65 0d 0d 4e 6f |batim}\e|code..No|
|000008e0| 74 65 20 74 68 61 74 20 | 69 6e 20 74 68 65 20 66 |te that |in the f|
|000008f0| 69 72 73 74 20 65 78 61 | 6d 70 6c 65 20 74 68 65 |irst exa|mple the|
|00000900| 20 72 65 74 75 72 6e 20 | 76 61 6c 75 65 20 76 61 | return |value va|
|00000910| 72 69 61 62 6c 65 20 5c | 63 6f 64 65 7b 72 76 7d |riable \|code{rv}|
|00000920| 20 77 69 6c 6c 0d 68 6f | 6c 64 20 61 6e 20 69 6e | will.ho|ld an in|
|00000930| 74 65 67 65 72 20 76 61 | 6c 75 65 3b 20 69 6e 20 |teger va|lue; in |
|00000940| 74 68 65 20 73 65 63 6f | 6e 64 20 65 78 61 6d 70 |the seco|nd examp|
|00000950| 6c 65 20 69 74 20 77 69 | 6c 6c 20 68 6f 6c 64 20 |le it wi|ll hold |
|00000960| 61 20 73 74 72 69 6e 67 | 0d 76 61 6c 75 65 2e 0d |a string|.value..|
+--------+-------------------------+-------------------------+--------+--------+